package com.bdqn.spark.chapter05.action

import org.apache.spark.{SparkConf, SparkContext}

object Spark02_RDD_Operator_Action {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("action-reduce")
    val sc = new SparkContext(sparkConf)

    val rdd = sc.makeRDD(List(1,2,3,4),4)

    // collect : 方法会将不同分区的数据按照分区顺序采集到Driver端内存中，形成数组
    val ints1: Array[Int] = rdd.collect()
    println(ints1.mkString(","))

    sc.stop()
  }
}
